package com.crm.model.jdao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.crm.model.pojo.DetailedDemand;
import com.crm.model.pojo.DetailedDemand;
import com.crm.model.pojo.SalesOpportunity;
import com.crm.model.pojo.Solution;

public interface IDetailedDemandDAO extends CrudRepository<DetailedDemand,Integer> {

	/**
	 * 带条件的分页，查询所有客户需求
	 * @param <T>
	 * @return
	 * 
	 */
 
 Page<DetailedDemand> findAll(Specification<DetailedDemand> spec,Pageable pageable);
  
  /**
   * 统计对象个数
   */
  long count();
  
  /**
   * 根据id查询客户需求
   * @param salId
   * @return
   */
  //DetailedDemand findByQd_recordId(Integer qd_recordId);
  @Query("SELECT q FROM DetailedDemand q where q.demandId=?1")
  DetailedDemand queryByDemandId(Integer demand_Id);
  
  /**
   * 确认客户需求主题是否重复
   * @param salThme
   * @return
   */
  DetailedDemand findByDedTheme(String dedTheme);
  
 
	
}
